074 sorting of boxes based on weight part 3 of 3
好吧,现在我们必须根据配方制定排序逻辑?
Alright, now we have to make the logic for Sorting based on recipe?
..现在我们已经在最后的逻辑中看到了,这个食谱是我们最大的盒子将要直线的第一个食谱,因为两个滚筒都被重置了。
..now we have seen in the last logic and this recipe is a first recipe our largest boxes are going to straight because both the rollers were reset.
我们已经给了0-0..
We have given 0-0 ..
中型盒子向右移动,在这种情况下,为中型盒子设置右输送机或右滚筒,为小盒子设置左滚筒。
the medium box is going to right in that case right conveyor or right roller is SET for the medium box and for the small box left roller was SET.
原来排序是这么进行的?
That's how the sorting was going on?
现在对于其他食谱,如果您在这里看到其他食谱,我们有不同的大、中、小配置。
Now for the other recipes if you see here other recipes we have different configurations for large, medium and small.
好吧,我们要做的就是知道我们必须将 0-1 更改为 1-0 或其他基于逻辑的内容,然后我们就可以完成排序了?
Alright so what we have to do is we know that we have to just change the 0-1 to 1-0 or whatever it is based on the logic and we will get get the Sorting done?
因此,如果我们知道我们需要这个 - “不是常量”而是一个“变量”,我们必须用一个变量 - 布尔变量来更改所有这些布尔值,因为根据要求,它可能是 1 和 0。
So if we know that we need this - 'not constant' but a 'variable' we have to change all these Boolean values with a variable - the Boolean variable because that could be 1 and 0 based on the requirement.
所以我们不能在这里有一个常数,这是第一件事?
So we cannot have a constant here that's the first thing?
所以我们必须定义一个新的布尔变量,所以在这种情况下我们需要 6 个布尔变量,好吗?
So we have to define a new Boolean variables so in that case we need 6 Boolean variables ok ?
因此,我要做的不是定义 6 个变量,而是......
So instead of defining 6 variables what I'm going to do is...
我将定义一个包含六个元素的数组,您也可以采用六个变量,但是在这种情况下,六个元素的数组也是正确的吗?
I'm going to define an array of six elements you can also take six variables but array of six element is also correct in this case?
所以我们可以在临时数组中取出这个包含六个元素的数组。
So we can take this array of six element in our temporary..
在我们的临时数据类型中,因为我们没有用作输入或输出,所以我们可以将其用作临时数据类型吗?
in our temporary data type because we are not using as an input or as an output we can use it as a temporary?
所以在这里我将使用 Io 只写“temp”,这里将是一个布尔数组数组,因为这是 0 和 1..
So here I'm going to use Io am going to write just 'temp' and here will be array an array of Boolean because this is 0 and 1..
不是“real”,不是“int”——布尔值没问题,我们需要 6 个元素..
not 'real', not 'int' -- Boolean is okay and we need 6 elements ..
好吧,这里的“0”将是我的第一个?
all right so this here '0' will be my first?
好吧,我们已经使用了 temp,所以为了避免混淆,我将使用“排序”,所以这是我的第一个排序元素。
Alright we have already used temp so to avoid confusion, i am going to use 'sorting' so this is my first element of sorting.
这是我的第二元素、第三元素、第四元素、第五元素和第六元素。
This is my 2nd element, 3rd element, 4th element, 5th element and 6th element.
所以这里我可以写排序和元素0。
So here I can write sorting and element 0.
这是我的第一个元素..
That's my first element..
没关系,我会复制这里的一个,这是我的第二个元素,这里是我的第三个元素,这里是我的第四个元素,这同样是第五个,结果是六个,所以哦,抱歉?
that's okay I will copy that one here this is my second element and here my third element here is my fourth element and this comes similarly fifth and this comes out to be six so oh sorry ?
一二这将是 4,一旦你知道了顺序就可以了。
one two this will be 4, all right once you know the sequence..
您可以将序列移动到该数组元素中,好吗?
you can just move the sequence into this array element okay?
为此,我们必须编写在顶部编写的代码,这样我们就知道对于第一个食谱,我在这里制作了一个表格......
For that we have to write the code we write on the top so we know that for first recipe I have made a table here ...
所以这里的第一个食谱排序 0,排序 1 ..
so the first recipe here Sorting 0, Sorting 1 ..
这是我的前两个变量......
these are my first two variables ...
因为如果你看到颜色..
for if you see the color..
对于较大的盒子 对于较大的盒子,我们不希望左滚轮和右滚轮打开,我们希望它们关闭。
for the larger box for the larger box we don't want left roller and right roller to be ON, we want these to be OFF.
所以它将是 0-0 并出现蓝色“中” - 中应该向右移动以使其向右移动..
so it will be 0-0 and comes the blue color 'medium' - Medium should go to right to make it go to right ..
在这种情况下,左滚轮应关闭,右标尺应打开。
in this case left roller should be OFF and right rulers should be ON..
现在媒体也去了吧?
now the medium also go to right?
现在我们有了更小的盒子..
Now we have the smaller box ..
它向左移动,在这种情况下,左滚轮将打开,右滚轮将关闭。
this goes to left, in this case left roller will be ON and right roller will be OFF.
好的,这就是您进行配置的方式..
Okay this is how you make the configuration ..
现在有第二个食谱吗?
now comes with the second recipe?
左边的变量相同,对于更大的盒子,这种颜色更大的盒子将要写入,在这种情况下,左边是 0,右边是 1,你会发现这与我们在这里所做的不同,因为选择不同。
The same variables for the left, for the larger box this color the larger box is going to write in this case left is 0, right is 1 you will see that this is different from what we did here, because of the choices.
现在我们有一个向左的中框,所以左边会高(1),右边会低(0)。
Now we have medium box going to left so left will be high (1), right will be low (0)..
这是黄色的小盒子,要直的..
this is yellow smaller box is going to straight ..
这将是0-0。
this will be 0-0.
希望,现在你可以很容易地快速说对于更大的盒子,他们要离开..
Hope, it easy now you can quickly say for larger box, they are going to left ..
所以左边将是高(1),右边将是低(0),现在这个蓝色是中0-0,黄色是右边,所以这里右滚轮应该打开,左边应该关闭,所以你可以看到没有一个配置匹配,这意味着您写入表的逻辑是正确的,所以现在我们必须制定一个逻辑来移动这个值..
so the left will be High (1) Right will be low(0), now this blue is medium 0-0 and yellow is right so here right roller should be ON, left should be OFF, so you can see that none of the configuration is matching it means your logic of writing the table is correct so now we have to make a logic to move this value ..
现在这个值这个菜谱是根据菜谱“输入”选择的,我将再次采用之前删除的输入?
now this value this recipe is selected based on the recipe 'input' which again I'm going to take on the input which was deleted before?
我们将采取食谱...
We will take recipe...
我们正在采用哪个配方,这是整数,因为我们将输入值 0、1 或 2。
which recipe we are taking and this is integer because we are going to put the values 0, 1 or 2.
因此,当配方编号为 0 时,就会选择“配方 1”,因此我将其写为“0”以避免混淆。
So this 'Recipe 1' is selected when the Recipe number is 0, so I will just write it '0' to avoid confusion.
1和2,因为如果数据寄存器的值被重置-它将返回到主配方-“默认配方”,因此配方0,如果该配方数据寄存器的值为1,则如果值为2,则将选择该配方- 这会被选中吗?
1 and 2 because if the value of data register is reset- It will go back to the main recipe - 'Default recipe' so Recipe 0, if the value of this recipe data register is 1 this recipe will be selected if the values is 2 - this will be selected?
所以当值为 0 时...
So when the value is 0 ...
所以让我们回到这里,我们将转到这里,以便您可以开始写作,因为我们必须在顶部定义配方,我们可以在这里写..
so let's go back here and we'll go here so you can start writing because we have to define recipe on the top we can write here ..
配方逻辑,这可以通过 PLC 的其他不同控制命令来完成,但当您开始学习如何将值移动到数组和配方中时,这是最简单、最快的方法之一。
Recipe Logic, this can be done with another different control commands of PLC, but this is one of the easiest, the quickest way when you're starting learning how to move values into an array and the recipe.
因此,如果配方整数的值为“1”,则为“0”(抱歉)..
So if the value of recipe integer is '1' is '0' (Sorry) ..
那么如果食谱 = 0 那么会发生什么?
so IF recipe = 0 then what should happen?
排序0的值应该是0,排序0应该是0。
value of sorting 0 should be 0, Sorting 0 should be 0.
然后我用这个复制粘贴..six 排序 1, 2, 3, 4, 5 0 是 0,1 是 0,2 是 0,3 是 1 这也是 1,那是 0。
Then I with this copy-paste..six Sorting 1, 2, 3, 4, 5 0 is 0, 1 is 0, 2 is 0, 3 is 1 this is also 1, that's 0.
这个是一样的..
This is the same ..
我已经从表中取出了值,好吗?
i have taken the value from the table alright?
因为我们知道您在做什么并且您可以END_IF;好的,如果配方的值为“1”..
Because we know what you are doing and you can END_IF; Ok if, the value of recipe is '1'..
所以现在我将快速复制粘贴,在这种情况下我们必须使用“第二个表”..这是..
so now I will quickly copy-paste in this case we have to use the '2nd table' ..which is..
0-1-1-0-0-0 所以这是 1 酷吗?
0-1-1-0-0-0 so this is 1 Cool?
现在我们同样采用配方 2..
Now similarly we'll take the Recipe 2..
在这种情况下..
in this case..
1-0-0-0-0-1 可以吗?
1-0-0-0-0-1 Okay?
现在假设用户输入大于 2 或小于零的配方编号。
Now suppose that the user enter the recipe number greater than 2 or less than zero..
在这种情况下,让我们将其恢复为 0..
in that case let's make it back to 0..
所以我们会写 IF 配方..
so we will write IF recipe..
用户将输入的号码..
the number which user will enter..
如果大于 2 或小于 0,则配方应为 0。
If is greater than 2 or is less than 0 then the recipe should be 0.
这是为了避免任何错误,你知道吗?
This is to avoid any errors you know?
万一; ..好吧,这就是逻辑 - 就是这样?
END_IF; ..Okay so this is the logic - That's it?
您已经创建了一个配方逻辑,如果您返回主逻辑,则必须更新,因为我们已经采用了新的输入,因此配方我可以将其视为任何位,让我们将其视为 MB30。
You have created a recipe logic and if you go back to your main logic you have to update because we have taken a new input so the recipe I can take it as any bits let's take it MB30.
好吧,一切都好,我们的食谱逻辑已经完成了吗?
Alright so everything is ok our logic is complete for recipes?
让我们下载并检查 - 下载 - 最初数据寄存器 MB30* 为 0 ..所以这将遵循第一个配方..
Let's download and check - Download - initially the data register MB30* is 0 ..so this will follow the first recipe..
因为该值为零,所以您可以显示它,所以让我们看看 Factory I/O 中发生了什么。
because this value is zero you can display that all right so let's see what's going on in Factory I/O.
这是同样的食谱。
This is the same recipe going on..
更大的盒子会直接..
larger box is going to straight..
左边是小瓶子,右边是中盒子,可以吗?
smaller bottles to left and medium boxes to right okay?
现在让我们更改配方并转到“配方 1”修改操作数。
Now let's change the recipe and go to 'Recipe 1' modify operand..
现在它应该基于中号框向左工作......
now it should work based on that the medium box going to left ...
中型盒子应该放在左边..
medium box should go to left..
大盒子应该放在右边 - 对吗?
large box should go to right - correct?
较小的盒子应该直接走吗?
Smaller box should go straight?
这很酷 ..
This is cool ..
现在让我们再次更改配方 - 配方 2 不过,我们应该在机器停止时更改配方?
now let's change the recipe again - Recipe 2 Although, we should change the recipe when the machine is STOP?
但你只需确保盒子不在主秤上即可。
But you just make sure the box is not on the main scale..
现在其余的都改变了,所以更大的盒子将会离开..
now the rest is changed so larger boxes are going to left..
这是较大的盒子,有一个中等的盒子会向右走,而较小的盒子会向右走?
that's the larger box and there's a medium box going to straight and smaller box will go to right?
所以事情正在按照我们的意愿进行。
So things are working as what we desire.
中号盒子走直线,小号盒子走右边,可以吗?
Medium box going to straight, smaller box should go to right that's okay?
所以这是关于如何使用一些小的数组逻辑和比较来根据不同配方的重量进行排序,这并不困难,对吗?
So this is about how you can do sorting based on weight with different recipe using some little logic of arrays and comparison it's not that difficult right?
现在列出的逻辑的最后一部分是对这里的盒子进行计数,我们只需要对出口传感器中的盒子进行计数,并提供重置盒子计数的功能,好吗?
Now what was list the last part of the logic was to count the boxes here we just have to count the boxes from the exit sensor and a provision to reset the box count okay?
所以你在这里看到驱动程序,我们在这里有盒子计数电阻器,我要做的是我将使用传感器 - 退出传感器并对盒子进行计数,所以让我们使用“否”对盒子进行计数,开始逻辑..
So you see here drivers we have the Box count resistors here what I'm going to do is I'm going to use the sensor - exit sensors and count the box so let's count the box using NO, Begin the logic ..
计算球数的逻辑方法不是通过常开触点,我们应该通过这些传感器的传感器的下降沿来进行计数。
the logical way to count the balls is not by the NO contact we should do it by the falling edge of the sensor of these sensor.
下降沿会说 - 是的,盒子已离开传送带,这样更适合对盒子进行计数。
The falling edge will say - Yes the box has left the conveyor that would be more appropriate count the boxes.
好吧,现在在这种情况下,因为我们正在使用..
Alright now here in this case since we are using..
如果您看到传感器的类型,则默认情况下传感器处于打开状态,因为这里有一个反射物体,当盒子来时,传感器关闭,让盒子来。
if you see the type of sensor the sensor is ON by default because of this reflective object here when the box come then sensor goes OFF, let the box come..
您会看到传感器关闭。
you will see the sensor goes OFF.
好的?
Ok?
那么在这种情况下我们应该做的是我们应该使用上升沿吗?
So in this case what we should do is we should use the rising edge?
现在为什么不是下降沿呢?
Now why not the falling edge?
如果传感器是NO型,我们应该使用下降沿吗?
Falling edge we should use if the sensor is a NO type?
但传感器是 NC 型..NC 型意味着当物体存在时它已经打开..这会关闭,这是一个 NC 型,当您注意到我们需要脉冲时,盒子就会离开这部分..
But the sensor is NC type ..NC type means it is already ON when the object is there..this goes OFF this is a NC type and when you notice we want the pulse then the box leave this part..
盒子会离开这个部分,传感器会再次打开吗?
the box will leave this part and the sensor will be ON again?
好吧,所以你想看我可以用慢动作给你看,让我们来一个盒子吧?
Alright so you want to see I can show you in slow motion let's have a box?
好的,我们可以看到那部分..
Okay we can see at that part..
我们想让盒子里有一个脉冲离开..现在注意到慢动作了吗?
we want to have a pulse in the Box leave..now notice the slow motion?
传感器即将关闭..
Sensor is going to get OFF ..
我们不需要下降沿,如果你采取下降沿,我们会在这里得到脉冲,这不是我们想要的......
we don't need a falling edge if you take a falling edge we will get the pulse here this is not desire...
传感器应该关闭,我们需要在盒子里留下一个脉冲......在这部分?
sensor should be OFF, we need a pulse in the box leave..at this part?
在这部分(实例)-传感器再次打开..
At this part (instance)- Sensor goes ON again..
如果你想要..我可以..这又开始了..
if you want ..I can..this is ON again..
我可以再给你看一次..
I can show you again..
这是传感器关闭的部分(实例)。
this is a part (instance) where sensor goes OFF..
我们不需要这个脉冲。
we don't need this pulse.
当传感器再次开启时我们需要一个脉冲。
We need a pulse when sensor goes ON again.
那么,当盒子离开这部分时,我们将得到一个“上升沿”——这个?
So when the box leave this part we will get a 'rising edge' - this one?
我们需要使用项目的这一部分,因此对于这里的所有传感器,我将使用上升沿,好吗?
We need to use this part of our project so for all the sensors again here I will use the rising edge okay?
因此将其更改为“P”,以便第一个传感器保留 I0.2。
So changing that to 'P' so the first sensor is left I0.2.
- 对不起 ..
- I'm sorry ..
这是我写的一个非常普遍的错误。
it's a very general mistake i write..
写'10.2'现在我们可以使用上升沿的M0.2,这将把+1添加到另一个寄存器或QD104中以增加它..我们也可以在SCL中做到这一点,但没关系,我们可以制作一个梯子逻辑..
write '10.2' now we can use M0.2 of a rising edge and this is going to add +1 into another register or QD104 to increment that ..We can do that in SCL as well but it's ok, we can make a ladder logic ..
你必须使用ADD命令转到数学并在这里找到ADD命令好吗?
you have to use an ADD command Goto Maths and find an ADD command here okay?
输入是 QD104 ...+1 ...再次存储到 QD104 可以吗?
input is QD104 ...+1 ...store again into QD104 ok?
那么当我们有左退出脉冲时,它会将+1添加到我的左计数上?
So it will add +1 to my left count when we have a left exit pulse?
同样,在这里我只需复制粘贴此内容并更改标记?
So similarly here i will just copy-paste this one and change the tagging?
这将是右侧的 I0.3 - 出口右侧 I0.3 右侧我们有 QD108 ..
That will be I0.3 for the right - exit right I0.3 for the right we have QD108 ..
没关系,这也会改变 - QD108 然后我们再次需要前进或前进,我们有 I0.4,你可以更改为 M0.4,这将是 QD112..再次在这里..这是一个简单的逻辑,添加 1基于传感器的寄存器?
it's okay this will also change - QD108 then again we need for the forward or forward we have I0.4 and you can change to M0.4, this will be QD112..again here..this is a simple logic to add one to the register based on the sensors?
好吧,现在我可以在同一个网络中完成此操作。我们还必须根据“重置”开关重置此计数的值,因此我将采用一个重置开关,这是 I1.2 - 重置计数,它会进行将所有该寄存器中的值移至 0。
Alright now, I could have done this in the same network anyways ..we also have to reset the values of this counts based on the 'reset' switch so I will take a reset switch this is I1.2 - reset count and it's going to move the value 0 in all this register.
所以移动 - 移动可以吗?
So move - Move is okay?
现在动什么?
Now move what?
-“0”我们有三个,所以再拿一个吗?
- '0' we have three so take one more?
QD104、QD108、QD112——这是左计数、右计数和前计数?
QD104, QD108, QD112- this is left count, right count and forward count?
现在剩下的就是重量了..
Now what is left is the weight..
我们必须显示重量,所以如果您知道箱子的重量,您可以计算重量,因为我不确定这些箱子的重量,我要做的是……
we have to display the weight so if you know the weight of your boxes you can calculate the weight since I'm not sure the weight of these boxes how much weight they have what I'm going to do is ..
我只需将电压乘以 10。
I'm going to just multiply the voltage with 10.
让我们考虑增益系数为 10,这意味着如果重量为 4.0,则为 40 千克,如果重量为 5.0,则为 50 千克,如果重量为 7.5,则电压为 7.5..这意味着它为 75 千克 让我们采用此假设,因此我们有显示重量,这样我们也可以在这里这样做,这是有意义的..
Let's consider the gain factor is 10 which means the if the weight is 4.0 it's 40 kg, if the weight is 5.0 it's 50 kg, if the weight is 7.5 voltage is 7.5..it means it's 75 Kg Let's take this assumption so we have to display the weight so we can do that also here that make sense..
是的,因为我们正在读取块内的重量,所以我们可以编写“重量显示”,让我们得到一个全是 Weight_display 的输出?
yeah because we are reading the weight inside the block we can write the 'weight display' let's take an output that's all Weight_display?
将 SCL“weight_display”中的值转换为 DINT 很容易,我们正在获取实际值。
It's easy to convert the values in SCL 'weight_display' is DINT and we are getting the value in real.
所以我们必须将值转换为权重 - 这是 DINT (double int) 抱歉?
So we have to convert the value so weight - This is DINT (double int) Sorry ?
这相当于..
this is equivalent to ..
让我为您放大当前的权重 - 实际上是乘以 10,让我们看看是否可以将此值转换为 double int。
Let me zoom it for you the current weight - which is in real multiply it by 10 and let's see if you can convert this value into double int.
来源“real”-“Double int”-是的,我们可以做到吗?
Source 'real' - 'Double int' - Yes we can do that?
所以我们可以采用这种格式并将其放入其中。
So we can take this format and put this inside it.
所以weight_display是Real到int,所以这个乘法将是“real”,我们应该将其转换为“double int”并显示输出?
So weight_display is Real to int so this multiplication will be 'real' we should convert it into 'double int' and will be displayed output?
所以我会在面板上显示重量发表评论。
So i will put a comment For displaying weight on panel.
因此,实际重量显示将乘以 10 并转换为 DINT,因为这是在 Factory IO 中工作的要求。
So weight display which was in real going to multiply with 10 and convert into DINT because this is the requirement for working in Factory IO.
所以回到主块更新块..
So go back to main blocks update the blocks..
他们在这里有一个我们刚刚创建的重量显示。
they have a weight display here which we just created.
返回驾驶员体重显示为QD100。
Go back to driver weight display is QD100.
放QD100就一切OK了吗?
Put QD100 everything is OK?
下载逻辑,这是今天课程的最后一部分好吧..
Download the logic and this was the final part of today's lesson All right..
一切都很顺利,我们只需要看起来很重要..
everything is working we just need to seem to counts..
所以之前的计数让我重置..
so the previous counts let me reset..
已重置,您现在可以在此处看到重量吗?
this is reset and you can see the weight here now?
50..
50..
50 公斤,左边是“2”..50 公斤,因为它已经消失了,所以这里是 1,所以您可以看到正在计算盒子并且重量在这里?
50 kg and this is '2' on the left ..50 Kg and since it's gone it's 1 here so you can see that the box is being counted and the weight is here?
还好这个小了..
Alright this is a smaller..
所以这将出现在那里,这将是 1 好吧,我希望你觉得本课很有趣,并且你不知道如果你有一个实时体重秤并且你想记录这些值,你必须做什么,因为我们正在使用真正的控制器,因此如果您有类似的环境,您也可以使用此逻辑,或者您可以根据您在自己的过程中使用的传感器进行一些细微的更改,但这是一个非常现实的逻辑 - 如何对盒子进行排序并基于它们重量,如果您有 HMI 或一些按钮,因为我正在通过软件更改此配方,而我们在行业中通常不这样做..
so this will go there and this will be 1 Alright, I hope you find this this lesson interesting and you get little idea what you have to do if you have a real time weighing scale and you want to record the values since we are using the real controller so you can also use this logic if you have a similar environment or you can make some minor changes based on the sensor you are using in your own process but this is quite a realistic logic - how to sort the box and based on their weight and if you have a HMI or some buttons because I am changing this recipe by software which we don't do generally in the industry ..
哪里是?
where is that?
在这里,我使用修饰符来完成它,而你不这样做。
Here I'm doing it using modifier which you don't do that.
您还可以在此处使用一些按钮,然后使用该按钮来增加配方,好吗?
You can also take some button here and you can use that button to increment the recipe okay?
假设我这里有一个菜谱,我有一个数字显示的菜谱,我可以按一个按钮来增加菜谱,然后我可以选择我想要的菜谱?
Suppose I have a recipe here I have a recipe in numerical display I can take a button to increment the recipe and I can select which recipe I want?
好吧,让我们这样做吧..
Alright ok let's do that ..
这很有趣,因为我也喜欢这个想法,所以我只需要一个可以在最后一个网络中使用的按钮..
this this is quite interesting since I also like the idea so I just need a button which I can take in the last Network ..
我这里也需要一个按钮..
I need a button here as well ..
所以很抱歉我必须停止它并按下按钮我可以按下这个绿色(否)按钮,让我们将其保留在这里,让我们移动它,没关系,我将复制这个并将其放在这里,我要走了要更改其名称,我将输入“食谱编号”,这是我的食谱编号,这将是“选择食谱”..
so I'm sorry I have to stop it and to take the button I can take this green (NO) button and let's keep it here let's move it and it's okay and I will just duplicate this one put it here and I'm going to change its name I will put 'Recipe number' that's my recipe number and this will be Select Recipe ..
好吧,等等,发生了什么?
okay so wait what what happened ?
抱歉..这是输出是的,因为我们的输出也有不同的标签 - 对于我更改的灯光,因此选择配方和配方编号所以“选择配方”让我们将其分配给某些输入 - I0.5 是我的选择食谱让我们进入逻辑并按下按钮,我想要它的上升沿和 I0.5 ..M0.5 ..这将增加我的食谱......
Sorry ..this is the output yeah because we have a different tag for the output as well - for the light which I change so select recipe and recipe number So 'select recipe' let's assign it to some input - I0.5 is my select recipe let's go to the logic and take the button and I want it's rising edge and I0.5 ..M0.5..This is going to increment my recipe...
这就是我可以更改它的方式,所以再次好吧,我可以复制它..
this is how I can change it so again ok I can just copy that..
它会增加什么?
what will it increment?
它会增加这个MB30好吗?
it will increment this MB30 alright?
MB30 - 加 1 并在 MB30 中再次输出。
MB30 - increment with 1 and output again in MB30.
我希望它没有改变任何事情..
I hope it did not change anything ..
好的?
ok?
因此,这个配方启动的值将是 0,将上升到 1,然后如果我们转到 2 并且该值达到 3,它应该重置自身,它不应该超过 3,所以我可以使用比较器命令..让我们采取如果 MB30 的值为 3,则并行,这不是必需的,因为我们只有三个配方,第一个配方为 0,第二个配方为 1,第三个配方为 2。
So the value of this recipe initiate will be 0 that will go up to 1 then if we go to to 2 and the value comes to 3 it should reset itself it should not go beyond 3 so I can use a comparator command ..let's take a parallel if the value of MB30 is 3 which is not required because we just have three recipes the first recipe will be 0, second will be 1, third will be 2.
第四个将是 3,所以不需要 3,我们将重置它,所以采取移动命令?
Fourth will be 3 so 3 is not required we will reset that so take move command ?
怎么删除呢?
How to delete it?
好吧,将 0 移至 MB30 好吗?
all right Move 0 into MB30 okay?
那么,如果您想在工厂 I/O 上也显示该内容,您现在可以选择这样的方式吗?
So this is how you can select now if you want to display that as well on your Factory I/O?
因为它是双整型,并且我们使用的是简单字节,所以我们必须将此字节转换为 DINT 让我采用转换器输入 INT ...
Because it's the double int and we are using simple byte we have to convert this byte into DINT let me take a converter Input in INT ...
这里我们需要 DINT MB30 应该是字节?
here we need DINT MB30 It should be byte?
好吧,让我们做一件事......让我们把这个值作为 INT,配方的值是一个“INT”,好吧,好吧,然后我们出去吧..
Alright let's do one thing ...let's take this value as INT, the value for the recipe this is an 'INT' okay that's okay then let's go out..
我在这里用“MW30”这个词,好吗?
I will use the 'word' here - MW30 okay?
MW30...
MW30...
MW30 DINT - 我需要显示屏中的输出...
MW30 DINT - I need the output in the display...
显示的是我们的食谱编号。
the displays is our recipe number.
好吧,我们使用 QD116 好吗?
Ok let's use QD116 alright?
这就是制作食谱按钮的方法。
This is how you make the button for recipe.
加载程序?
Load the program?
我们应该重置..
We should reset..
为什么这是500?
why this is at 500?
我需要检查一下,也许它以前被使用过,所以让我重置它?
I need to check it maybe it was in used before so let me reset it?
是的,现在是“0” - 哦,我没有在这里更改,抱歉 - 这应该是 WORD?
yeah '0' now - oh I did not change here I'm sorry - this should be WORD?
是的加载配置我也可以使用-大于等效来下载是的现在这个值不会超过3。
yeah loading the configuration I can also use - Greater than Equivalent to download yeah now this value will not not go beyond 3.
所以这是一个食谱 0,在这个更大的盒子里,一切正常,让我们看看另一个盒子来验证食谱..
So this is a Recipe 0, in this our bigger box was going straight all right and let's see another box to verify the recipe ..
中型盒子会向右移动..
medium box is going to right..
那么现在我们改变一下食谱吧?
so now let's change the recipe?
我可以通过这个按钮进行更改-只需按一次..第一个食谱,这意味着这个食谱..
I can change from this button- Just press it once ..First recipe which means this recipe ..
这是第零个食谱..
this was zeroth recipe..
第一个食谱 第一个食谱 - 更大的盒子会好吗?
first recipe the first recipe - larger box are going to right?
这个还可以吧..
This is okay..
这是一个小盒子会直接完美吗?
this is a small box is going to straight perfect?
让我们看看下一个食谱 - 食谱 2..
let's check the next recipe -Recipe 2..
在“2”中,这是中型向右走,大向左走。
in '2' this is the medium going to straight okay and large going to left..
好吧,这个按钮所发生的一切只是我们只是......哦......
Alright so what's all happening with this button is only that we are just ...oh..
是的,使用这个按钮,我们只是增加和减少这里的值,您可以注意到它是 2..
yeah with this button we are just incrementing and decrementing the values here You can notice that it is 2..
0所以我用修改打开做的事情我可以用按钮来做,因为我通过这个逻辑控制这个MW30,我按下这个按钮一旦要在MW30中添加一个我就会增加,如果上面的值“3”或“3”..这将返回“0”,因此该值只会更改为“1”“2”或“0”好吧,这就是您更改配方的方式,您实际上应该更改当...当操作停止时..的配方
0 so the thing which I was doing with modify open I can do with the button because I'm controlling this MW30 by this logic and I press this button once going to add one in MW30 I'm going to increment, if the values above '3' or at '3' ..this will go back to '0' so the value will only change to '1' '2' or '0' Alright so this is how you can change the recipe and you should actually change the recipe when the ..when the operation is Stopped..
这样你就可以从食谱 0 重新开始..
so you can start again with the Recipe 0 ..
如果您对这个食谱不满意,您可以通过按“停止”来更改食谱,然后再次更改食谱,这些是我们也可以重置的计数器,好吗?
and you're not happy with this recipe you can change the recipe by pressing STOP and change the recipe again these are the counter which we can also reset okay?
这是关于如何根据权重进行排序的一个小例子,所以那些正在寻找这个例子的人我希望你能从这个逻辑中找到一些信息。
So this is about a small example of how to do sorting based on weight so those who are looking for this example I hope you find some some information from this logic..
从这节课开始,我希望你喜欢这个视频......
from this lesson and I hope you like this video...
如果您有任何疑问,您可以发表评论,或者可以给我写一封电子邮件,好吗?
if you have any doubt you know that you can put a comment or you can write me an email alright?
感谢您的观看..祝您度过愉快的一天?
Thank you for watching ..Have a nice day?